<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>企业HR下的分仓岗位</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/base.css"/>
		<!--	<link rel="stylesheet" href="../../css/index.css"/>-->
		<style>
			body, #mian {
				background-color: #f3f5f7;
				/*	width: 100%;
				 height: 100%;*/
				padding: 0;
				margin: 0
			}
			.mui-table-view {
				position: relative;
				margin-top: 0;
				margin-bottom: 0;
				padding-left: 0;
				list-style: none;
				background-color: #fff;
				border-radius: 10px;
				margin-left: 10px;
				margin-right: 10px;
				margin-top: 10px;
			}
			.mui-table-view-cell > a:not(.mui-btn) {
				padding: 10px;
			}
			.mui-table-view-cell > a:not(.mui-btn) .course-img {
				display: block;
				width: 60px;
				height: 60px;
				background-image: url(image/course_placehoder.png);
				border: 1px solid #fff;
				border-radius: 50px;
				margin-right: 10px;
			}
			.mui-table-view-cell .top-content {
				height: 32px;
				margin-top: 6px;
			}
			.mui-table-view-cell .bottom-content {
				/*		padding-top: 16px;
				 height: 44px;*/
			}
			.course_name {
				font-size: 14px;
				color: #222;
				line-height: 20px;
			}
			.mui-table-view-cell > a:not(.mui-btn) .subtitle {
				color: #999;
				font-size: 12px;
				overflow: hidden;
				white-space: normal;
				text-overflow: ellipsis;
				line-height: 14px;
			}
			.bottom-content .cell-content-left {
				padding-right: 68px;
				float: left;
			}
			.bottom-content .cell-content-right {
				padding-top: 10px;
				width: 68px;
				height: 42px;
				float: right;
				position: absolute;
				right: 10px;
				top: 50px;
			}
			.tag-img {
				width: 14px;
				height: 14px;
				margin-right: 4px;
				vertical-align: bottom;
			}
			.left-span {
				float: right;
			}
			.competition-top-tag {
				background-size: 30px;
				background-image: url(../../image/icon_screen_hr.png);
				background-position: center left;
				background-repeat: no-repeat;
				padding-left: 34px;
				font-size: 14px;
				color: #000000;
				line-height: 30px;
				line-height: 50px;
				background-color: #fff;
			}
			.div-title-style {
				padding-left: 15px;
				background-color: #fff;
			}
			.grade-right-style {
				float: right;
				color: #FB6B0B;
				font-size: 12px;
				line-height: 14px;
			}
			.mui-navigate-right:after, .mui-push-left:after, .mui-push-right:after {
				color: #cdd0d5;
			}
			.mui-table-view-cell:active {
				color: #fff;
				background-color: #fff;
			}
		</style>
	</head>
	<body>
	<div class="div-title-style">
			<div class="competition-top-tag"  id="classificationId" >
				选择:全部
			</div>
		</div>
		<div id="mian">
		<ul id="highView" class="mui-table-view">
		<!--	<li class="mui-table-view-cell mui-media li-padding-10" >
			<span class="base_black_grey font16">历史最高</span>
			</li>
				<li class="mui-table-view-cell mui-media li-padding-10" >
					<a href="javascript:;"  class="li-padding-10"> <img class=" mui-pull-left course-img" src="../../image/course_placehoder.png"/>
					<div class="mui-media-body top-content">
						<span class="course_name"> 汪小二 </span>
						<span class="grade-right-style"><img class="tag-img" src="../../image/icon_grade_analyze.png">总成绩:100分</span>
					</div>
					<div class="mui-media-body bottom-content">
						<p class="mui-ellipsis subtitle">
							<span ><img class="tag-img" src="../../image/icon_shijian.png">学习时间:100小时</span>
							<span class="left-span"><img class="tag-img" src="../../image/icon_test_scores.png">成绩:85分</span>
						</p>
					</div> </a>
				</li>
			-->
			</ul>
			<ul id="pView" class="mui-table-view">
			<!--<li class="mui-table-view-cell mui-media li-padding-10" >
			<span class="base_black_grey font16">人员成绩</span>
			</li>
				<li class="mui-table-view-cell mui-media li-padding-10" onclick="openwind()">
					<a href="javascript:;"  class="li-padding-10"> <img class=" mui-pull-left course-img" src="../../image/course_placehoder.png"/>
					<div class="mui-media-body top-content">
						<span class="course_name"> 汪小二 </span>
						<span class="grade-right-style"><img class="tag-img" src="../../image/icon_grade_analyze.png">总成绩:100分</span>
					</div>
					<div class="mui-media-body bottom-content">
						<p class="mui-ellipsis subtitle">
							<span ><img class="tag-img" src="../../image/icon_shijian.png">学习时间:100小时</span>
							<span class="left-span"><img class="tag-img" src="../../image/icon_test_scores.png">成绩:85分</span>
						</p>
					</div> </a>
				</li>
				<li class="mui-table-view-cell mui-media li-padding-10" onclick="openwind()">
					<a href="javascript:;"  class="li-padding-10"> <img class=" mui-pull-left course-img" src="../../image/course_placehoder.png"/>
					<div class="mui-media-body top-content">
						<span class="course_name"> 汪小二 </span>
						<span class="grade-right-style"><img class="tag-img" src="../../image/icon_grade_analyze.png">总成绩:100分</span>
					</div>
					<div class="mui-media-body bottom-content">
						<p class="mui-ellipsis subtitle">
							<span ><img class="tag-img" src="../../image/icon_shijian.png">学习时间:100小时</span>
							<span class="left-span"><img class="tag-img" src="../../image/icon_test_scores.png">成绩:85分</span>
						</p>
					</div> </a>
				</li>-->
			</ul>
		</div>
		<div class="noSign" hidden="hidden" id="noData">
			<img src="../../image/icon_img.png" width="60%">
			<p class="font16 top_15 base_dark_grey" >
				暂无数据
			</p>
		</div>
		<div class="loadFailure" hidden="hidden" id="noNet">
			<img src="../../image/icon_img01.png" width="60%">
			<p class="" >
				数据加载失败
			</p>
			<p>
				请检查您的网络
			</p>
			<button type="button"  onclick="loadData()"class="mui-btn mui-btn-outlined">
				重新加载
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/common.js"></script>
	<script type="text/javascript">
		var page = 1;
		var row = 10;
		var refreshCount = 0;
		var categoryIsShow = false;
		var cid = '';//企业id
		 var gid = '';//岗位id
		apiready = function() {
			  loadNewData();
			 setRefreshHeader();
		     setPullUpRefresh();
		    
		    setupNotifi();
			 onSelectCategoryClick();
		};
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		function loadNewData() {
			page = 1;
			loadData();
		}

		function loadMoreData() {
			page++;
			loadData();
		}

		//获取班级学生列表
		function loadData() {
			showProgress();
			pageParam = api.pageParam;
			var params = {
				jid : $api.getStorage('cfnetppjid'),
				uid : $api.getStorage('cfnetppuid'),
				page : page,
				rows : row,
				cid :cid,
				gwid:gid
			};
//			console.log(JSON.stringify(params));
			//									alert(JSON.stringify(params));
			cfnetppPOST(urlHRgwCourseExamlst, params, true, function(data, status) {
				//																alert(JSON.stringify(data));
				api.hideProgress();
				api.refreshHeaderLoadDone();
				if (status == 'success') {
					if (data.code == 200) {
					   var datas = data.json;
						var list = datas.studentlst;
						var historylist = datas.historyTop;
//						alert(JSON.stringify(list));
						refreshCount = list.length;
						if (list != '' && list.constructor == Array && list.length > 0) {
							$('#noData').hide();
							$('#noNet').hide();
							$('#mian').show();
							writelist(list, refreshCount,historylist);
						} else {
							if (page == 1) {
								$('#noData').show();
								$('#noNet').hide();
								$('#mian').hide();
							}
						}
					} else if (data.code = 109) {
						if (page == 1) {
							$('#noData').show();
							$('#noNet').hide();
							$('#mian').hide();
						}
					} else {
						if (page == 1) {
							$('#noData').show();
							$('#noNet').hide();
							$('#mian').hide();
						}
					}
				} else {
					$('#noData').hide();
					$('#noNet').show();
					$('#mian').hide();
				}
			});
		}

		function writelist(datas, len,historylist) {
		     
			
			 if(historylist.length>0){
			    var data = historylist[0];
			 	var picpath = HeadPortraitIsNull(data.imgs);
				var stime = parseInt((data.studyTime)/60);
			    var htmls = '<li class="mui-table-view-cell mui-media li-padding-10" >'+
			              '<span class="base_black_grey font16">历史最高</span>'+
			             '</li>'+
				          '<li class="mui-table-view-cell mui-media li-padding-10" >'+
						'<a href="javascript:;"  class="li-padding-10">'+
						' <img class=" mui-pull-left course-img" src="' + picpath + '"/>'+
		              '<div class="mui-media-body top-content">'+
							'<span class="course_name"> '+data.studentname+ '</span>'+
							'<span class="grade-right-style"><img class="tag-img" src="../../image/icon_grade_analyze.png">总成绩:'+data.zongfen+'分</span>'+
						'</div>'+
						'<div class="mui-media-body bottom-content">'+
							'<p class="mui-ellipsis subtitle">'+
								'<span ><img class="tag-img" src="../../image/icon_shijian.png">学习时间:'+stime+'分钟</span>'+
								'<span class="left-span"><img class="tag-img" src="../../image/icon_test_scores.png">成绩:'+data.fenshu+'分</span>'+
							'</p>'+
					
						'</div> </a>'+
					'</li>';
				
			  $('#highView').html(htmls);
			 }else{
			   $('#highView').html("");
			 }
			 var chtmls = '';
			for (var i = 0; i < len; i++) {
				var data = datas[i];
				var picpath = HeadPortraitIsNull(data.imgs);
//				alert(data.studyTime);
				var stime = parseInt((data.studyTime)/60);
				var chtml ='<li class="mui-table-view-cell mui-media li-padding-10" >'+
					'<a href="javascript:;"  class="li-padding-10">'+
					' <img class=" mui-pull-left course-img" src="' + picpath + '"/>'+
	              '<div class="mui-media-body top-content">'+
						'<span class="course_name"> '+data.studentname+ '</span>'+
						'<span class="grade-right-style"><img class="tag-img" src="../../image/icon_grade_analyze.png">总成绩:'+data.zongfen+'分</span>'+
					'</div>'+
					'<div class="mui-media-body bottom-content">'+
						'<p class="mui-ellipsis subtitle">'+
							'<span ><img class="tag-img" src="../../image/icon_shijian.png">学习时间:'+stime+'分钟</span>'+
							'<span class="left-span"><img class="tag-img" src="../../image/icon_test_scores.png">成绩:'+data.fenshu+'分</span>'+
						'</p>'+
				
					'</div> </a>'+
				'</li>'
				chtmls = chtmls + chtml;
			}
			
			if (page == 1) {
			     chtmls = '<li class="mui-table-view-cell mui-media li-padding-10" ><span class="base_black_grey font16">人员成绩</span></li>'+chtmls;
				$('#pView').html(chtmls);
			} else {
				$('#pView').append(chtmls);
			}
		}

	function onSelectCategoryClick(){
		
		$('#classificationId').unbind('click');
		$('#classificationId').click(function(event){
		
			if (categoryIsShow == true) {
				api.setFrameAttr({
				    name: 'CourseCategoryWind',
				    hidden: true
				});
				categoryIsShow = false;
			}else{
				var y = $(".competition-top-tag").height()+66;
		         var h = api.winHeight - y;
				api.openFrame({
				    name: 'CourseCategoryWind',
				    url: 'CourseCategoryWind.html',
				    rect: {
				        x: 0,
				        y: y,
				        w: 'auto',
				        h: h
				    },
				    bounces: false,
				    bgColor:'rgba(0,0,0,.3)'

				});
				api.setFrameAttr({
				    name: 'CourseCategoryWind',
				    hidden: false
				});
				categoryIsShow = true;
			}
			})
		}
		 function setupNotifi(){

			api.addEventListener({
			    name: 'jobCategoryNotifi'
			}, function(ret, err) {
			    cid = ret.value.cId;
				gid = ret.value.gId;
				var CategoryTitle = ret.value.cTitle;
				var warehouse = ret.value.warehouse;
				if(parseInt(cid) == 0){//全部企业
				$('#classificationId').text("选择: "+"全部");
				}else if(parseInt(gid) == 0){//全部岗位
				$('#classificationId').text("选择: "+warehouse);
				} else{
				  	$('#classificationId').text("选择: "+warehouse+"-"+CategoryTitle);
				}
                 
				categoryIsShow = false;
                 loadNewData();
			});
		}
	</script>
</html>